//
//  TOrderInfoDAL.h
//  CarSalesMS_GCX
//
//  Created by Ssky on 2016/11/10.
//  Copyright © 2016年 Tony. All rights reserved.
//

#import <Foundation/Foundation.h>
@class TOrderInfoModel;
@class TSaleInfoModel;

@interface TOrderInfoDAL : NSObject

+ (NSString *)loadOrderNoLast;

+ (NSArray<TOrderInfoModel *> *)loadOrderListWithOrderNo:(NSString *)orderNo;

+ (TOrderInfoModel *)loadOrderModelWithOrderNo:(NSString *)orderNo;

+ (TOrderInfoModel *)loadOrderModelTopOneOrderByTimeDescWithTime:(NSString *)time;

+ (NSArray<TOrderInfoModel *> *)loadOrderListWithTimeBegin:(NSString *)timeBegin timeEnd:(NSString *)timeEnd;

//+ (TOrderInfoModel *)getOrderInfoModelWithOrderNo:(NSString *)orderNo totalCount:(int)totalCount totalMoney:(CGFloat)totalMoney unitCount:(NSString *)unitCount unitMoney:(NSString *)unitMoney saleModel:(TSaleInfoModel *)saleM;


#pragma mark - inert
+ (NSInteger)insertIntoDbWithOrderModel:(TOrderInfoModel *)orderModel;

+ (NSArray *)insertIntoDbWithOrderList:(NSArray<TOrderInfoModel *> *)orderList;




#pragma mark - update

+ (void)updateOrderModel:(TOrderInfoModel *)orderModel;

+ (void)updateOrderList:(NSArray<TOrderInfoModel *> *)orderList;

+ (void)updateOrderModel:(TOrderInfoModel *)orderModel withOrderNo:(NSString *)orderNo;



#pragma mark - create new orderModel

+ (NSString *)getOrderNoStr;

///生成新订单
+ (TOrderInfoModel *)getOrderModelWithOrderNo:(NSString *)orderNo saleList:(NSArray<TSaleInfoModel *> *)saleModelList;



















@end
